#ifndef _DSWWATCHDOG_H
#define _DSWWATCHDOG_H
#include <libbase/dswbase.h>
#include <linux/watchdog.h>

class CDswwatchdog : public CDswbase
{
public:
	CDswwatchdog(LPST_ENV_T pEnv);
	virtual ~CDswwatchdog();
private:
	static void cbWatchDogTask(int fd, short events, void* ctx){((CDswwatchdog*)ctx)->WatchDogTask(fd, events);};
	void WatchDogTask(int fd, short events);

	static void* cbWatchDogThreadFunc(void* pParam){((CDswwatchdog*)pParam)->WatchDogThreadFunc();return NULL;};
	void WatchDogThreadFunc();
protected:
	virtual int OnMessage(EN_MSG_TYPE nMsgType, void* pParam);
private:
	ST_TIMER_PARAM_T m_nWatchDogTask;
	int m_nWatchDogFd;
	pthread_t m_nWatchDogThreadID;
};

#endif

